import React from 'react';
import ReactDOM from 'react-dom/client';
import { ConfigProvider } from 'antd';
import { useAuthStore } from './store/authStore'
import zhCN from 'antd/locale/zh_CN';
import AppRouter from './router';
import GlobalMessage from './components/GlobalMessage';
import './index.css';

// 引入Ant Design样式
import 'antd/dist/reset.css';
useAuthStore.getState().initAuth();

ReactDOM.createRoot(document.getElementById('root')!).render(
  <React.StrictMode>
    <ConfigProvider locale={zhCN} theme={{
      token: {
        colorPrimary: '#1677ff',
        fontFamily: 'Inter, system-ui, sans-serif'
      }
    }}>
      <GlobalMessage />
      <AppRouter />
    </ConfigProvider>
  </React.StrictMode>
);
